import matplotlib.pyplot as plt
from pylab import mpl
import akshare as ak

# 指定字体中文编码
mpl.rcParams['font.sans-serif'] = ['SimHei']
mpl.rcParams['axes.unicode_minus'] = False

df = ak.stock_zh_a_hist(symbol="000002",
                        period="daily",
                        start_date="20220414",
                        end_date='20230414')

df.plot(kind="line", title="股票行情线图", x="日期", y=["收盘", "开盘"])
plt.show()